@page "/rich-text-editor/preview"

@using Syncfusion.Blazor.RichTextEditor

@inherits SampleBaseComponent;

<div class="control-section">
    <div class="control-wrapper">
        <div class="control-section">
            <SfRichTextEditor EditorMode="EditorMode.Markdown">
                <ChildContent>
In Rich Text Editor , you can click the toolbar buttons to format the words and the changes will be visible immediately. 
Markdown is not like that. When you format the word in Markdown format, you need to add Markdown syntax to the word to indicate which words 
and phrases should look different from each other

Rich Text Editor supports markdown editing when the editorMode set as **markdown** and using both *keyboard interaction* and *toolbar action*, you can apply the formatting to text.

We can add our own custom formation syntax for the Markdown formation, [sample link](http://npmci.syncfusion.com/development/demos/#/material/rte/markdown-editor-custom-format.html).

The third-party library <b>Marked</b> is used in this sample to convert markdown into HTML content.
                <RichTextEditorToolbarSettings Items="@Items" />
                </ChildContent>
            </SfRichTextEditor>
        </div>
    </div>
</div>

<style>
    .e-richtexteditor textarea.e-content {
        float: left;
        border-right: 1px solid rgba(0, 0, 0, 0.12);
    }

    .e-richtexteditor .e-rte-content .e-content {
        min-height: 150px;
    }

    .e-richtexteditor .e-rte-content {
        overflow: hidden;
    }

    .e-icon-btn.e-active .e-md-preview::before {
        content: '\e350';
    }

    .e-icon-btn .e-md-preview::before {
        content: '\e345';
    }

    .bootstrap4 .e-icon-btn.e-active .e-md-preview::before {
        content: '\e790';
    }

    .bootstrap4 .e-icon-btn .e-md-preview::before {
        content: '\e787';
    }

    .e-rte-content .e-content {
        float: right;
        width: 50%;
        overflow: auto;
        height: inherit;
        padding: 8px;
        height: 100%;
    }

        .e-rte-content .e-content.e-pre-source {
            width: 100%;
        }

    .highcontrast .e-richtexteditor textarea.e-content {
        border-right: 1px solid #fff;
    }
</style>

@code{
    private List<ToolbarItemModel> Items = new List<ToolbarItemModel>()
    {
        new ToolbarItemModel() { Command = ToolbarCommand.Bold },
        new ToolbarItemModel() { Command = ToolbarCommand.Italic },
        new ToolbarItemModel() { Command = ToolbarCommand.StrikeThrough },
        new ToolbarItemModel() { Command = ToolbarCommand.Separator },
        new ToolbarItemModel() { Command = ToolbarCommand.Formats },
        new ToolbarItemModel() { Command = ToolbarCommand.OrderedList },
        new ToolbarItemModel() { Command = ToolbarCommand.UnorderedList },
        new ToolbarItemModel() { Command = ToolbarCommand.Separator },
        new ToolbarItemModel() { Command = ToolbarCommand.CreateLink },
        new ToolbarItemModel() { Command = ToolbarCommand.Image },
        new ToolbarItemModel() { Command = ToolbarCommand.CreateTable },
        new ToolbarItemModel() { Command = ToolbarCommand.Separator },
        new ToolbarItemModel() { Command = ToolbarCommand.Undo },
        new ToolbarItemModel() { Command = ToolbarCommand.Redo }
    };
}